<style lang="scss" scoped>
.dynamic {
  padding: 0.15rem;
  &:last-child::after {
    color: fff;
    border: none;
  }
  .dynamic_info {
    line-height: 0.16rem;
    p {
      padding: 0.04rem 0;
    }
  }
}
.empty {
  height: 3rem;
}
</style>

<template>
    <!-- 楼盘动态 begin -->
    <div class="full bgfff">
        <ul>
            <li class="dynamic bgfff border-b" v-for="(it,i) in list" :key="i">
                <div class="dynamic_info">
                    <div>{{it.dynamicTitle}}</div>
                    <p class="c82 font-12">{{it.dynamicDescribe}}</p>
                    <div class="c82 font-12">{{it.createTime | toTime('yyyy年MM月dd日')}}</div>
                </div>
            </li>
            <li class="box-center c82 empty" v-show="!list.length">暂无楼盘动态</li>
        </ul>
    </div>
    <!-- 楼盘动态 end -->
</template>

<script>
export default {
  name: "houses_dynamic",
  data() {
    return {
      page: 0,
      pageSize: 100,
      list: []
    };
  },
  mounted() {
    let that = this;
    this.$nextTick(() => {
      that.getList();
    });
  },
  methods: {
    getList(has = false) {
      let that = this;
      let page = (this.page = ++this.page);
      if (has && page > this.totalPage) {
        this.layer("已加载全部", "m");
        return;
      }
      this.http
        .get("housesdynamic/list", {
          page: page,
          limit: that.pageSize,
          housesCode: that.$route.params.id
        })
        .then(res => {
          that.totalPage = res.totalPage;
          if (has) {
            that.list.push(res.data.list);
          } else {
            that.list = res.data.list;
          }
        })
        .catch(err => {});
    }
  }
};
</script>


